#! /bin/bash
echo 'AC_CONFIG_SUBDIRS([' > modules.m4
ls -1 modules | while read line; do
	if test -f "modules/$line/configure.ac"; then
		echo "modules/$line" >> modules.m4
		echo Rebuilding configure in $line
		cp acinclude.m4 "modules/$line"
		cd "modules/$line"
		autoreconf || exit 1
		cd -
	fi
done
echo Rebuilding top level configure...
echo '])' >> modules.m4

autoreconf
